#lang r5rs
(define (fringe x)
  (define (iter x result)
    (cond
      ((null? x) result)
      ((not (pair? (car x))) (iter (cdr x)(append result (list (car x)))))
      ((pair? (car x)) (iter (cdr x)(append result (iter (car x) '()))))
      
      )
    )
  (iter x '()))
(define x (list (list 1 2) (list 3 4)))
(display (fringe x))